//
//  TableViewCell.swift
//  swift-03
//
//  Created by xuPeng on 2017/8/4.
//  Copyright © 2017年 陈旭鹏. All rights reserved.
//

import UIKit


struct video {
    let image: String
    let title: String
    let source: String
}
class TableViewCell: UITableViewCell {
    
    var videoScreenshot: UIImageView!
    var videoTitleLabel: UILabel!
    var videoSourceLabel: UILabel!
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
        super.init(coder: aDecoder)
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
    }
    override init(style: UITableViewCellStyle, reuseIdentifier: String?)
    {
        super.init(style: UITableViewCellStyle.default, reuseIdentifier: reuseIdentifier)
        creatUI()
    }
    

    
    func creatUI(){
        self.videoTitleLabel = UILabel.init()
        self.videoTitleLabel?.backgroundColor = UIColor.clear;
        self.videoTitleLabel?.frame = CGRect(x:5, y:0, width:150, height:30)
        self.videoTitleLabel?.text = "Title"
        self.videoTitleLabel.textAlignment = NSTextAlignment.left
        self.videoTitleLabel?.textColor = UIColor.black
        self.videoTitleLabel?.font = UIFont.systemFont(ofSize: 15)
        self.videoTitleLabel?.textAlignment = NSTextAlignment.left
        self.addSubview(self.videoTitleLabel!)
        
        self.videoSourceLabel = UILabel.init()
        self.videoSourceLabel?.backgroundColor = UIColor.clear;
        self.videoSourceLabel?.frame = CGRect(x:5, y:70, width:150, height:20)
        self.videoSourceLabel?.text = "Title"
        self.videoSourceLabel.textAlignment = NSTextAlignment.left
        self.videoSourceLabel?.textColor = UIColor.black
        self.videoSourceLabel?.font = UIFont.systemFont(ofSize: 15)
        self.videoSourceLabel?.textAlignment = NSTextAlignment.left
        self.addSubview(self.videoSourceLabel!)
        
        self.videoScreenshot = UIImageView()
        self.videoScreenshot?.frame = CGRect(x:UIScreen.main.bounds.size.width - 60, y:30, width:50, height:50)
        self.videoScreenshot?.backgroundColor = UIColor.lightGray
        self.videoScreenshot?.image = UIImage.init(named: "a")
        self.addSubview(self.videoScreenshot!)
    }
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
